<style>
	.menu_dropdown>dl>dt {
		position: relative;
	}

	.menu_dropdown>dl>dt>a {
		position: absolute;
		display: block;
		height: 100%;
		width: 100%;
		top: 0;
		left: 0;
		background-color: transparent;
	}

	#menu-message li {
		position: relative;
	}

	.noread dt i:first-of-type {
		color: red !important;
	}


	.child-system-message:after {
		position: absolute;
		content: "";
		display: block;
		background-color: red;
		width: 8px;
		height: 8px;
		border-radius: 50%;
		left: 50px;
		top: 25px;
	}

	.child-order-message:after {
		position: absolute;
		content: "";
		display: block;
		background-color: red;
		width: 8px;
		height: 8px;
		border-radius: 50%;
		left: 50px;
		top: 25px;
	}

	.child-user-message:after {
		position: absolute;
		content: "";
		display: block;
		background-color: red;
		width: 8px;
		height: 8px;
		border-radius: 50%;
		left: 50px;
		top: 25px;
	}

	.Hui-aside .menu_dropdown dl .selected {
		background-color: #b7b7b7;
		color: #fff;
	}

	.Hui-aside .menu_dropdown dl .selected~dd {
		display: block;
	}

	.Hui-aside .menu_dropdown dl .selected i {
		color: #fff;
	}

	.Hui-aside .menu_dropdown dl .selects a {
		color: #2196f3;
	}
	/* 消息弹出框 */
	.message_alert{
		width: 300px;
		height: 140px;
		box-sizing: border-box;
		padding: 15px 30px;
		background: #fff;
		z-index: 9999;
		display: none;
	}
	.message_alert .message_alert_list .message_alert_single a{
		display: block;
		color: #333;
		font-size: 14px;
		padding: 0;
		border:none;
		float: right;
		margin-left: 15px;
		font-weight: 400;
		background-color: transparent
	}
	.message_alert .message_alert_list .message_alert_single a:hover{
		color: #2196f3;
		background-color: transparent;
	}
</style>
<script>
</script>
<aside class="Hui-aside" style="top:100px;">
	<div class="menu_dropdown bk_2">
		<dl id="menu-article">
			<dt class="home_index"><i class="Hui-iconfont">&#xe67f;</i>首页<a href="{:url('home/index')}" title="首页"> </a></dt>
		</dl>
		<dl id="menu-order" style="display:<?php echo (!in_array(session('merchant.merchant_id'),config('__MERCHANT_ID__')) ? "block" : "none");?>;">
			<dt class="order_index"><i class="Hui-iconfont">&#xe63a;</i>交易管理<a href="{:url('order/index')}" title="交易管理"> </a></dt>
		</dl>
		<dl id="menu-borrow-order" style="display:<?php echo (!in_array(session('merchant.merchant_id'),config('__MERCHANT_ID__')) ? "none" : "block");?>;">
			<dt class="book_borroworder"><i class="Hui-iconfont">&#xe61e;</i>图书交易管理<a href="{:url('book/borrowOrder')}" title="图书交易管理"> </a></dt>
		</dl>
		<dl id="menu-goods" style="display:<?php echo (!in_array(session('merchant.merchant_id'),config('__MERCHANT_ID__')) ? "block" : "none");?>;">
			<dt class=""><i class="Hui-iconfont">&#xe620;</i>商品管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
			<dd>
				<ul>
					<li class="goods_showlist">
						<a href="{:url('goods/showlist')}" title="所有商品">所有商品</a>
					</li>
					<li class="goods_addgoods">
						<a href="{:url('goods/addgoods')}" title="添加商品">添加商品</a>
					</li>

					<li class="leasingrules_showlist">
						<a href="{:url('leasingrules/showlist')}" title="租赁规则/合约模板">租赁规则/合约模板</a>
					</li>
				</ul>
			</dd>
		</dl>
		<dl id="menu-books" style="display:<?php echo (!in_array(session('merchant.merchant_id'),config('__MERCHANT_ID__')) ? "none" : "block");?>;">
			<dt class=""><i class="Hui-iconfont">&#xe639;</i>图书管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
			<dd>
				<ul>
					<li class="book_listbook">
						<a href="{:url('book/listBook')}" title="图书列表">图书列表</a>
					</li>
					<li class="book_createbook">
						<a href="{:url('book/createBook')}" title="添加图书">添加图书</a>
					</li>
				</ul>
			</dd>
		</dl>
		<dl id="menu-activity" style="display:<?php echo (!in_array(session('merchant.merchant_id'),config('__MERCHANT_ID__')) ? "block" : "none");?>;">
			<dt class=""><i class="Hui-iconfont">&#xe627;</i>营销活动<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
				<dd>
					<ul>
						<li class="activity_listactivity">
							<a href="{:url('activity/listActivity')}" title="活动列表">活动列表</a>
						</li>
						<li class="activity_listpingtaiactivity">
							<a href="{:url('activity/listPingTaiActivity')}" title="平台活动">平台活动</a>
						</li>
						<li class="activity_addactivity">
							<a href="{:url('activity/addActivity')}" title="添加活动">添加活动</a>
						</li>
					</ul>
				</dd>
		</dl>
		<dl id="menu-coupon" style="display:<?php echo (!in_array(session('merchant.merchant_id'),config('__MERCHANT_ID__')) ? "block" : "none");?>;">
			<dt class=""><i class="Hui-iconfont">&#xe628;</i>优惠券<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
			<dd>
				<ul>

					<li class="coupon_listcoupon">
						<a href="{:url('coupon/listCoupon')}" title="优惠券列表">优惠券列表</a>
					</li>
					<li class="coupon_addcoupon">
						<a href="{:url('coupon/addcoupon')}" title="添加优惠券">添加优惠券</a>
					</li>
				</ul>
			</dd>
		</dl>
		<dl id="menu-picture">
			<dt class=""><i class="Hui-iconfont">&#xe669;</i>物流模板<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
			<dd>
				<ul>
					<li class="since_index" style="display:<?php echo (!in_array(session('merchant.merchant_id'),config('__MERCHANT_ID__')) ? "block" : "none");?>;"><a href="{:url('Since/index')}" title="自提点">自提点</a></li>
					<li class="freight_index" style="display:<?php echo (!in_array(session('merchant.merchant_id'),config('__MERCHANT_ID__')) ? "block" : "none");?>;"><a href="{:url('freight/index')}" title="运费模板">运费模板</a></li>
					<li class="revert_index"><a href="{:url('Revert/index')}" title="归还地址">归还地址</a></li>
				</ul>
			</dd>
		</dl>
		<dl id="menu-product" style="display:<?php echo (!in_array(session('merchant.merchant_id'),config('__MERCHANT_ID__')) ? "block" : "none");?>;">
			<dt class="page_rule"><i class="Hui-iconfont">&#xe636;</i>规则中心 <a href="{:url('page/rule')}" title="规则中心"></a></dt>

		</dl>
		<dl id="menu-message">
			<!-- noread未读状态添加该class -->
			<dt class=""><i class="Hui-iconfont">&#xe622;</i>消息中心
				<!-- <a href="{:url('message/showlist')}" title="消息中心"> --><i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
			<dd>
				<ul>
					<li class="message_systemmessage" id="child-system-message"><a href="{:url('message/systemmessage')}" title="系统消息">系统消息</a></li>
					<li class="message_ordermessage" id="child-order-message"><a href="{:url('message/ordermessage')}" title="订单消息">订单消息</a></li>
					<li class="message_usermessage" id="child-user-message"><a href="{:url('message/usermessage')}" title="用户留言">用户留言</a></li>
				</ul>
			</dd>
		</dl>
		<dl id="menu-company">
			<dt class=""><i class="Hui-iconfont">&#xe60c;</i>商家资料设置<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
			<dd>
				<ul>
					<li class="merchant_modify"><a href="{:url('merchant/modify')}" title="修改资料">修改资料</a></li>
					<li class="bankaccount_insert"><a href="{:url('bankaccount/insert')}" title="银行账号信息">银行账号信息</a></li>
				</ul>
			</dd>
		</dl>
		<dl id="menu-comments">
			<dt class="goodscomment_showlist" style="display:<?php echo (!in_array(session('merchant.merchant_id'),config('__MERCHANT_ID__')) ? "block" : "none");?>;"><i class="Hui-iconfont">&#xe63c;</i>评价管理 <a href="{:url('goodscomment/showlist')}" title="评价管理"></a></dt>
			<dt class="goodscomment_showlist" style="display:<?php echo (!in_array(session('merchant.merchant_id'),config('__MERCHANT_ID__')) ? "none" : "block");?>;"><i class="Hui-iconfont">&#xe63c;</i>评价管理 <a href="{:url('goodscomment/showbooklist')}" title="评价管理"></a></dt>
		</dl>
		<audio id="audioObj" style="display:none;" src="__MERCHANT_STATIC__/style/msg.mp3" controls="controls">
		</audio>
		<!-- 消息提示弹出框 -->
		<div class="message_alert">
			<ul class="message_alert_list">
				<li class="message_alert_single">
					您有新的系统消息了(<span></span>)
					<a href="/merchant/message/systemmessage.html">查看</a>
				</li>
				<li class="message_alert_single">
					您有新的订单消息了(<span></span>)
					<a href="/merchant/message/ordermessage.html">查看</a>
				</li>
				<li class="message_alert_single">
					您有新的用户留言了(<span></span>)
					<a href="/merchant/message/usermessage.html">查看</a>
				</li>
			</ul>
		</div>
	</div>
	<script>
		var audioObj = document.querySelector("#audioObj");
		//var baseUrl="http://127.0.0.1/";
		var baseUrl = "__BASE_URL__";

        /* 消息列表 */
        var messageList=$(".message_alert_single");

		$(function () {
			/* 自动检查是否有新消息 */
/* 			if (window.localStorage.getItem('getMessage')) {
				if (new Date().getTime() - window.localStorage.getItem('getMessage') > 3e5) {
					checkMessageRead();
					window.localStorage.setItem('getMessage', new Date().getTime());
				}
			} else {
				window.localStorage.setItem('getMessage', new Date().getTime());
				checkMessageRead();
			}*/
			checkMessageRead();

			//定时任务
			setInterval(function () {
				checkMessageRead();
			}, 18e4);
		});

        /* 用户新消息提示功能 */
        function checkMessageRead() {
            $.ajax({
                url: "../../api/message/getMessageTips",
                type: 'POST',
                success: function (response) {
                    if (response.status == 1) {
                        var List = response.data;
                        if (List.ct_system) {
                            messageList.eq(0).show();
                            messageList.eq(0).find("span").text(List.ct_system);
                            $("#child-system-message").addClass("child-system-message");
                        }else{
                            messageList.eq(0).hide();
                        }
                        if (List.ct_order) {
                            messageList.eq(1).show();
                            messageList.eq(1).find("span").text(List.ct_order);
                            $("#child-order-message").addClass("child-order-message");
                        }else{
                            messageList.eq(1).hide();
                        }
                        if (List.ct_user) {
                            messageList.eq(2).show();
                            messageList.eq(2).find("span").text(List.ct_user);
                            $("#child-user-message").addClass("child-user-message");
                        }else{
                            messageList.eq(2).hide();
                        }
                        $("#menu-message").attr("class", "noread");
                        $('#message_count').text(List.total);
                        //audioObj.play();
                        /* 展开消息提示框 */
                        /*							layer.open({
                                                        content: $(".message_alert"),
                                                        title: "消息提醒",
                                                        type:1,
                                                        shift: 2,
                                                        shade: 0,
                                                        area:["300px","185px"],
                                                        offset: 'rb',
                                                    });*/
                    } else {
                        $('#message_count').hide();
                    }
                }
            });
        }


		/* 左侧列表点击状态自己自动复位 */
		var hash = window.location.href.split('/');
		var obj = "." + hash[hash.length - 2] + "_" + hash[hash.length - 1].split(".")[0];
		if ($(obj).parents('dd').siblings('dt')[0]) {
			$(obj).parents('dd').siblings('dt').addClass("selected");
			$(obj).addClass("selects");
		} else {
			$(obj).addClass("selected");
		}
		$(".menu_dropdown dt").click(function () {
			$(this).parent().siblings().children("dt").removeClass("selected");
		});
	</script>
</aside>